package com.hanserwei.mydemo.stream;

import java.util.stream.IntStream;
import java.util.stream.Stream;

public class EffectiveTest2 {
    public static void main(String[] args) {
        Stream<Hero> heroStream = Stream.of(
                new Hero("令狐冲", 90),
                new Hero("风清扬", 98));
        IntStream intStream = heroStream.mapToInt(Hero::strength);
        intStream.forEach(System.out::println);
    }

    record Hero(String name, int strength) {

    }
}
